import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { viteMockServe } from 'vite-plugin-mock'

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		vue(),
		viteMockServe({
			mockPath: 'mock',
			localEnabled: true,
		}),
	],
	resolve: {
		alias: {
			'@': fileURLToPath(new URL('./src', import.meta.url)),
		},
	},
	define: {
		__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false', // 或者设置为 true，取决于你的需求
	},
})
